<?php

namespace platform\controllers;

use platform\core\BaseController;
use platform\interfaces\SysInterface;
use cm;
use platform\models\SysModel;

class SysController extends BaseController implements SysInterface
{
    function actionIndex()
    {
        $data = (new SysModel())->actionIndex();
        return Cm::$res->render($this, "index", $data, '系统配置');
    }

    function actionAuth()
    {
        $data = (new SysModel())->actionAuth();
        Cm::$cache->clear();
        return Cm::$res->render($this, "auth", $data, '权限管理');
    }

    function actionRole()
    {
        $data = (new SysModel())->actionRole();
        return Cm::$res->render($this, 'role', $data, '角色管理');
    }

    function actionManager()
    {
        $data = (new SysModel())->actionManager();
        return Cm::$res->render($this, 'manager', $data, '管理员管理');
    }
}